﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PCBase;
using PCBase.UIControls;

namespace PCBase.UIControls
{
    public partial class frmKeyBoard : Form
    {
        public frmKeyBoard()
        {
            InitializeComponent();
        }

        private void frmKeyBoard_Load(object sender, EventArgs e)
        {
            ucKeyBorderAll1.RetractClike += ucKeyBorderAll1_RetractClike;
        }

        public string DataString = "";

        void ucKeyBorderAll1_RetractClike(object sender, EventArgs e)
        {
            DataString = tbxInputData.Text;
            this.Visible = false;
        }

        public void ShowKeyBoard(Form ParentForm, string TitleString, string DataValue)
        {
            this.Text = "参数输入" + TitleString;
            DataString = DataValue;
            tbxInputData.Text = DataValue;

            tbxInputData.Focus();

            tbxInputData.Select(tbxInputData.TextLength, 0);

            this.StartPosition = FormStartPosition.CenterParent;
            this.ShowDialog(ParentForm);
        }

        public void ShowKeyBoard(Object owner, string TitleString, string DataValue)
        {
            this.Text = "参数输入" + TitleString;
            DataString = DataValue;
            tbxInputData.Text = DataValue;
            tbxInputData.Select(tbxInputData.TextLength, 0);
            tbxInputData.Focus();
            this.StartPosition = FormStartPosition.CenterParent;
            //this.ShowDialog();

            this.ShowDialog();
        }
    }
}
